<template>
  <div class="floor-card" :class="{left:index%2==1}" @click="goods(index)">
    <img style="width:100%" v-lazy="item.url" alt />
    <div class="desc">{{item.desc}}</div>
    <div class="desc-title">
      <div class="card-price">￥{{item.price}}</div>
      <div class="actived">{{item.active}}</div>
      <div class="similarity">相似</div>
    </div>
    <div style="height:26px;"></div>
  </div>
</template>
<script>
import store from "../../store/index.js";
export default {
  store,
  name: "floorcard",
  props: ["item", "index", "FloorCardList"],
  methods: {
    goods(index) {
      this.$router.push("/goodsdetails");
      this.$store.commit("FloorCardList", this.FloorCardList[index]);
      // console.log(this.FloorCardList[index])
    }
  }
};
</script>
<style>
.left {
  margin-left: 3px;
}
.similarity {
  text-align: center;
  color: #686868;
  font-size: 12px;
  width: 49px;
  height: 24px;
  line-height: 24px;
  border: 1px solid #bfbfbf;
  margin-right: 4px;
}
.actived {
  border: 1px solid #e4393c;
  color: #e4393c;
  font-size: 10px;
  padding: 0 3px;
  margin-right: 35px;
  white-space: nowrap;
}
.card-price {
  color: #f23030;
  font-size: 16px;
  height: 25px;
  line-height: 25px;
  padding: 0 5px 0 4px;
}
.floor-card {
  width: 49.5%;
  margin-bottom: 5px;
  background-color: #fff;
}
.desc {
  margin-bottom: 3px;
  padding: 0 4px;
  margin-top: 5px;
  height: 35px;
  font-size: 13px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.desc-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
</style>